import React,{Suspense} from 'react'
import {Spin} from 'antd'
const styles ={
    display:'flex',
    alignItems:'center',
    justifyContent: 'center',
    height:'100%'
}

export default function lazyLoad(
    Comp:React.LazyExoticComponent<React.ComponentType<any>>
):React.ReactNode{
    return(
        <Suspense fallback={<Spin size='large' style={styles}></Spin>}>
            <Comp></Comp>
        </Suspense>
    )
}
